package com.udl.emailfs.mail;

import java.util.Calendar;

import com.udl.emailfs.config.Config;
import com.udl.emailfs.filedirectory.TypeDescriptorFS;
import com.udl.emailfs.system.SystemFS;

public abstract class CType {

	protected String id;
	protected String name;
	protected long size;
	protected Calendar dateCreate;
	protected Calendar dateAccess;
	
	public CType(){		
	}
	
	public CType(TypeDescriptorFS tDescriptorFS, Config cfg){
        this.id = tDescriptorFS.getId();
        this.name = tDescriptorFS.getName();
        this.size = tDescriptorFS.getSize();
        this.dateCreate = Calendar.getInstance();
        this.dateAccess = Calendar.getInstance();
        this.dateCreate.setTime(SystemFS.getServerTime(cfg.getTimeServer()));
        this.dateAccess.setTime(SystemFS.getServerTime(cfg.getTimeServer()));
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getSize() {
		return size;
	}

	public void setSize(long size) {
		this.size = size;
	}

	public Calendar getDateCreate() {
		return dateCreate;
	}

	public void setDateCreate(Calendar dateCreate) {
		this.dateCreate = dateCreate;
	}

	public Calendar getDateAccess() {
		return dateAccess;
	}

	public void setDateAccess(Calendar dateAccess) {
		this.dateAccess = dateAccess;
	}

}
